using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VVABA
    {
        public DataRow Convert2VABA(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryVABA(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["VABMANDANT"] = " ".PadRight(2 ); 
         dwReturn["VABJAHR"] = " ".PadRight(4 ); 
         dwReturn["VABMONAT"] = " ".PadRight(2 ); 
         dwReturn["VABSART"] = " ".PadRight(3 ); 
         dwReturn["VABFRSCHL"] = " ".PadRight(100 ); 
         dwReturn["VABAUFART"] = " ".PadRight(2 ); 
         dwReturn["VABAUFTYP"] = " ".PadRight(1 ); 
         dwReturn["VABAUFKRS"] = " ".PadRight(2 ); 
         dwReturn["VABAUFLFD"] = " ".PadRight(6 ); 
         dwReturn["VABAUFPOS"] = " ".PadRight(3 ); 
         dwReturn["VABERSTAKZ"] = " ".PadRight(1 ); 
         dwReturn["VABPOSTYP"] = " ".PadRight(3 ); 
         dwReturn["VABCOUPON"] = " ".PadRight(1 ); 
         dwReturn["VABORDER"] = " ".PadRight(4 ); 
         dwReturn["VABPRGRP"] = " ".PadRight(8 ); 
         dwReturn["VABPROJNR"] = " ".PadRight(5 ); 
         dwReturn["VABAEDAT"] = " ".PadRight(0 ); 
         dwReturn["VABIAEDAT"] = " ".PadRight(0 ); 
         dwReturn["VABLITERM"] = " ".PadRight(0 ); 
         dwReturn["VABLIEFEING"] = " ".PadRight(8 ); 
         dwReturn["VABLIEFKOMP"] = " ".PadRight(1 ); 
         dwReturn["VABLTART"] = " ".PadRight(1 ); 
         dwReturn["VABVKSACHB"] = " ".PadRight(8 ); 
         dwReturn["VABVB"] = " ".PadRight(3 ); 
         dwReturn["VABVG"] = " ".PadRight(3 ); 
         dwReturn["VABVERTNR1"] = " ".PadRight(8 ); 
         dwReturn["VABVERTNR2"] = " ".PadRight(8 ); 
         dwReturn["VABVERTNR3"] = " ".PadRight(8 ); 
         dwReturn["VABVERTNR4"] = " ".PadRight(8 ); 
         dwReturn["VABLAND"] = " ".PadRight(3 ); 
         dwReturn["VABKZINLEXP"] = " ".PadRight(1 ); 
         dwReturn["VABPLZ"] = " ".PadRight(12 ); 
         dwReturn["VABGEBIET"] = " ".PadRight(3 ); 
         dwReturn["VABTLAND"] = " ".PadRight(2 ); 
         dwReturn["VABTREGBZ"] = " ".PadRight(2 ); 
         dwReturn["VABTKREIS"] = " ".PadRight(2 ); 
         dwReturn["VABTORT"] = " ".PadRight(3 ); 
         dwReturn["VABVERS"] = " ".PadRight(2 ); 
         dwReturn["VABKUNDNR"] = " ".PadRight(8 ); 
         dwReturn["VABVERBNR"] = " ".PadRight(8 ); 
         dwReturn["VABZENTRR"] = " ".PadRight(1 ); 
         dwReturn["VABZENTR"] = " ".PadRight(8 ); 
         dwReturn["VABBRANCHE"] = " ".PadRight(3 ); 
         dwReturn["VABABNGRP"] = " ".PadRight(3 ); 
         dwReturn["VABABCKL"] = " ".PadRight(1 ); 
         dwReturn["VABKUNDNRST"] = " ".PadRight(8 ); 
         dwReturn["VABABNGRPST"] = " ".PadRight(3 ); 
         dwReturn["VABBUSIMODE"] = " ".PadRight(3 ); 
         dwReturn["VABPRDGR"] = " ".PadRight(3 ); 
         dwReturn["VABARTGRP"] = " ".PadRight(3 ); 
         dwReturn["VABZIELGR"] = " ".PadRight(4 ); 
         dwReturn["VABPVGRP"] = " ".PadRight(3 ); 
         dwReturn["VABOBERKOLL"] = " ".PadRight(5 ); 
         dwReturn["VABKOLL"] = " ".PadRight(5 ); 
         dwReturn["VABVART"] = " ".PadRight(24 ); 
         dwReturn["VABVFARBE"] = " ".PadRight(10 ); 
         dwReturn["VABVGROE"] = " ".PadRight(7 ); 
         dwReturn["VABVZENSUR"] = " ".PadRight(1 ); 
         dwReturn["VABVAUFMART"] = " ".PadRight(2 ); 
         dwReturn["VABVVERPART"] = " ".PadRight(3 ); 
         dwReturn["VABLIEFSG"] = " ".PadRight(1 ); 
         dwReturn["VABVZOLLTNR"] = " ".PadRight(20 ); 
         dwReturn["VABSTATWNR"] = " ".PadRight(12 ); 
         dwReturn["VABPRODST"] = " ".PadRight(1 ); 
         dwReturn["VABDKUNDNR"] = " ".PadRight(8 ); 
         dwReturn["VABWERK"] = " ".PadRight(3 ); 
         dwReturn["VABABT"] = " ".PadRight(3 ); 
         dwReturn["VABDART"] = " ".PadRight(20 ); 
         dwReturn["VABDVAR"] = " ".PadRight(3 ); 
         dwReturn["VABPWAKZ"] = " ".PadRight(1 ); 
         dwReturn["VABPART"] = " ".PadRight(20 ); 
         dwReturn["VABPADESS"] = " ".PadRight(10 ); 
         dwReturn["VABPACOLORIT"] = " ".PadRight(10 ); 
         dwReturn["VABPABESCH"] = " ".PadRight(10 ); 
         dwReturn["VABPAFARBE"] = " ".PadRight(10 ); 
         dwReturn["VABPVAR"] = " ".PadRight(3 ); 
         dwReturn["VABPHK1"] = " ".PadRight(0 ); 
         dwReturn["VABPHK2"] = " ".PadRight(0 ); 
         dwReturn["VABPHK3"] = " ".PadRight(0 ); 
         dwReturn["VABPHK4"] = " ".PadRight(0 ); 
         dwReturn["VABPHK5"] = " ".PadRight(0 ); 
         dwReturn["VABPHK6"] = " ".PadRight(0 ); 
         dwReturn["VABPLART"] = " ".PadRight(20 ); 
         dwReturn["VABRFDDIS"] = " ".PadRight(0 ); 
         dwReturn["VABUMSATZAUFTR"] = " ".PadRight(0 ); 
         dwReturn["VABMENGE1"] = " ".PadRight(0 ); 
         dwReturn["VABMENGE2"] = " ".PadRight(0 ); 
         dwReturn["VABMENGE3"] = " ".PadRight(0 ); 
         dwReturn["VABMENGE4"] = " ".PadRight(0 ); 
         dwReturn["VABMENGE1T1"] = " ".PadRight(0 ); 
         dwReturn["VABMENGE1T2"] = " ".PadRight(0 ); 
         dwReturn["VABMENGE1T3"] = " ".PadRight(0 ); 
         dwReturn["VABMENGE1T4"] = " ".PadRight(0 ); 
         dwReturn["VABMENGEVT1"] = " ".PadRight(0 ); 
         dwReturn["VABMENGEVT2"] = " ".PadRight(0 ); 
         dwReturn["VABMENGEVT3"] = " ".PadRight(0 ); 
         dwReturn["VABMENGEVT4"] = " ".PadRight(0 ); 
         dwReturn["VABMENGEKOR1"] = " ".PadRight(0 ); 
         dwReturn["VABMENGEKOR2"] = " ".PadRight(0 ); 
         dwReturn["VABMENGEKOR3"] = " ".PadRight(0 ); 
         dwReturn["VABMENGEKOR4"] = " ".PadRight(0 ); 
         dwReturn["VABFAKTT1"] = " ".PadRight(0 ); 
         dwReturn["VABFAKTT2"] = " ".PadRight(0 ); 
         dwReturn["VABFAKTT3"] = " ".PadRight(0 ); 
         dwReturn["VABFAKTT4"] = " ".PadRight(0 ); 
         dwReturn["VABRABWERT"] = " ".PadRight(0 ); 
         dwReturn["VABZUABWERT"] = " ".PadRight(0 ); 
         dwReturn["VABTRANSCO"] = " ".PadRight(0 ); 
         dwReturn["VABWAEHRSL"] = " ".PadRight(3 ); 
         dwReturn["VABKURS"] = " ".PadRight(0 ); 
         dwReturn["VABBETRAG"] = " ".PadRight(0 ); 
         dwReturn["VABHWAEHRSL"] = " ".PadRight(3 ); 
         dwReturn["VABHEUROKURS"] = " ".PadRight(0 ); 
         dwReturn["VABHEUROKURSVK"] = " ".PadRight(1 ); 
         dwReturn["VABFEUROKURS"] = " ".PadRight(0 ); 
         dwReturn["VABFEUROKURSVK"] = " ".PadRight(1 ); 
         dwReturn["VABLESEKZ"] = " ".PadRight(1 ); 
         dwReturn["VABMWSTAB"] = " ".PadRight(0 ); 
         dwReturn["VABKUNDNRKO"] = " ".PadRight(8 ); 
         dwReturn["VABKOAUFKRS"] = " ".PadRight(2 ); 
         dwReturn["VABKOAUFLFD"] = " ".PadRight(6 ); 
         dwReturn["VABKOAUFPOS"] = " ".PadRight(3 ); 
         dwReturn["VABKOAUFART"] = " ".PadRight(2 ); 
         dwReturn["VABKOAUFKRS1"] = " ".PadRight(2 ); 
         dwReturn["VABKOAUFLFD1"] = " ".PadRight(6 ); 
         dwReturn["VABKOAUFPOS1"] = " ".PadRight(3 ); 
         dwReturn["VABKOAUFART1"] = " ".PadRight(2 ); 
         dwReturn["VABKKOLL"] = " ".PadRight(5 ); 
         dwReturn["VABMKOLL"] = " ".PadRight(5 ); 
         dwReturn["VABNOCOUNT"] = " ".PadRight(1 ); 
         dwReturn["VABFARBGRP"] = " ".PadRight(1 ); 
         dwReturn["VABVMVB"] = " ".PadRight(3 ); 
         dwReturn["VABVMVG"] = " ".PadRight(3 ); 
         dwReturn["VABKEYAC"] = " ".PadRight(8 ); 
         dwReturn["VABCOUNTY"] = " ".PadRight(4 ); 
         dwReturn["VABKONZMIT"] = " ".PadRight(1 ); 
         dwReturn["VABABSSCHL"] = " ".PadRight(3 ); 
         dwReturn["VABDISTRWEG"] = " ".PadRight(3 ); 
         dwReturn["VABWERBSL1"] = " ".PadRight(3 ); 
         dwReturn["VABWERBSL2"] = " ".PadRight(3 ); 
         dwReturn["VABWERBSL3"] = " ".PadRight(3 ); 
         dwReturn["VABWERBSL4"] = " ".PadRight(3 ); 
         dwReturn["VABWERBSL5"] = " ".PadRight(3 ); 
         dwReturn["VABKOLLSEG1"] = " ".PadRight(3 ); 
         dwReturn["VABKOLLSEG2"] = " ".PadRight(3 ); 
         dwReturn["VABKOLLSEG3"] = " ".PadRight(3 ); 
         dwReturn["VABKOLLSEG4"] = " ".PadRight(3 ); 
         dwReturn["VABKOLLSEG5"] = " ".PadRight(3 ); 
         dwReturn["VABFEATURE1"] = " ".PadRight(4 ); 
         dwReturn["VABFEATURE2"] = " ".PadRight(4 ); 
         dwReturn["VABFEATURE3"] = " ".PadRight(4 ); 
         dwReturn["VABFEATURE4"] = " ".PadRight(4 ); 
         dwReturn["VABFEATURE5"] = " ".PadRight(4 ); 
         dwReturn["VABEINSATZG"] = " ".PadRight(4 ); 
         dwReturn["VABVERWEND"] = " ".PadRight(4 ); 
         dwReturn["VABABZKZ"] = " ".PadRight(1 ); 
         dwReturn["VABVTYP"] = " ".PadRight(1 ); 
         dwReturn["VABFILLER"] = " ".PadRight(52 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapVABA(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveVABA(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryVABA(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapVABA(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertVABA(dwLocal, ITXDBVERSION);
            }
            UpdateVABA(dwLocal);
        }
        public void InsertVABA(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO VABA(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryVABA(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM VABA WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM VABA  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "VABA";
            Return = Result;
            return Return;
        }
        public void DeleteVABA(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM VABA   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateVABA(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE VABA SET "
                    +"VABMANDANT= :VABMANDANT,"
                    +"VABJAHR= :VABJAHR,"
                    +"VABMONAT= :VABMONAT,"
                    +"VABSART= :VABSART,"
                    +"VABFRSCHL= :VABFRSCHL,"
                    +"VABAUFART= :VABAUFART,"
                    +"VABAUFTYP= :VABAUFTYP,"
                    +"VABAUFKRS= :VABAUFKRS,"
                    +"VABAUFLFD= :VABAUFLFD,"
                    +"VABAUFPOS= :VABAUFPOS,"
                    +"VABERSTAKZ= :VABERSTAKZ,"
                    +"VABPOSTYP= :VABPOSTYP,"
                    +"VABCOUPON= :VABCOUPON,"
                    +"VABORDER= :VABORDER,"
                    +"VABPRGRP= :VABPRGRP,"
                    +"VABPROJNR= :VABPROJNR,"
                    +"VABAEDAT= :VABAEDAT,"
                    +"VABIAEDAT= :VABIAEDAT,"
                    +"VABLITERM= :VABLITERM,"
                    +"VABLIEFEING= :VABLIEFEING,"
                    +"VABLIEFKOMP= :VABLIEFKOMP,"
                    +"VABLTART= :VABLTART,"
                    +"VABVKSACHB= :VABVKSACHB,"
                    +"VABVB= :VABVB,"
                    +"VABVG= :VABVG,"
                    +"VABVERTNR1= :VABVERTNR1,"
                    +"VABVERTNR2= :VABVERTNR2,"
                    +"VABVERTNR3= :VABVERTNR3,"
                    +"VABVERTNR4= :VABVERTNR4,"
                    +"VABLAND= :VABLAND,"
                    +"VABKZINLEXP= :VABKZINLEXP,"
                    +"VABPLZ= :VABPLZ,"
                    +"VABGEBIET= :VABGEBIET,"
                    +"VABTLAND= :VABTLAND,"
                    +"VABTREGBZ= :VABTREGBZ,"
                    +"VABTKREIS= :VABTKREIS,"
                    +"VABTORT= :VABTORT,"
                    +"VABVERS= :VABVERS,"
                    +"VABKUNDNR= :VABKUNDNR,"
                    +"VABVERBNR= :VABVERBNR,"
                    +"VABZENTRR= :VABZENTRR,"
                    +"VABZENTR= :VABZENTR,"
                    +"VABBRANCHE= :VABBRANCHE,"
                    +"VABABNGRP= :VABABNGRP,"
                    +"VABABCKL= :VABABCKL,"
                    +"VABKUNDNRST= :VABKUNDNRST,"
                    +"VABABNGRPST= :VABABNGRPST,"
                    +"VABBUSIMODE= :VABBUSIMODE,"
                    +"VABPRDGR= :VABPRDGR,"
                    +"VABARTGRP= :VABARTGRP,"
                    +"VABZIELGR= :VABZIELGR,"
                    +"VABPVGRP= :VABPVGRP,"
                    +"VABOBERKOLL= :VABOBERKOLL,"
                    +"VABKOLL= :VABKOLL,"
                    +"VABVART= :VABVART,"
                    +"VABVFARBE= :VABVFARBE,"
                    +"VABVGROE= :VABVGROE,"
                    +"VABVZENSUR= :VABVZENSUR,"
                    +"VABVAUFMART= :VABVAUFMART,"
                    +"VABVVERPART= :VABVVERPART,"
                    +"VABLIEFSG= :VABLIEFSG,"
                    +"VABVZOLLTNR= :VABVZOLLTNR,"
                    +"VABSTATWNR= :VABSTATWNR,"
                    +"VABPRODST= :VABPRODST,"
                    +"VABDKUNDNR= :VABDKUNDNR,"
                    +"VABWERK= :VABWERK,"
                    +"VABABT= :VABABT,"
                    +"VABDART= :VABDART,"
                    +"VABDVAR= :VABDVAR,"
                    +"VABPWAKZ= :VABPWAKZ,"
                    +"VABPART= :VABPART,"
                    +"VABPADESS= :VABPADESS,"
                    +"VABPACOLORIT= :VABPACOLORIT,"
                    +"VABPABESCH= :VABPABESCH,"
                    +"VABPAFARBE= :VABPAFARBE,"
                    +"VABPVAR= :VABPVAR,"
                    +"VABPHK1= :VABPHK1,"
                    +"VABPHK2= :VABPHK2,"
                    +"VABPHK3= :VABPHK3,"
                    +"VABPHK4= :VABPHK4,"
                    +"VABPHK5= :VABPHK5,"
                    +"VABPHK6= :VABPHK6,"
                    +"VABPLART= :VABPLART,"
                    +"VABRFDDIS= :VABRFDDIS,"
                    +"VABUMSATZAUFTR= :VABUMSATZAUFTR,"
                    +"VABMENGE1= :VABMENGE1,"
                    +"VABMENGE2= :VABMENGE2,"
                    +"VABMENGE3= :VABMENGE3,"
                    +"VABMENGE4= :VABMENGE4,"
                    +"VABMENGE1T1= :VABMENGE1T1,"
                    +"VABMENGE1T2= :VABMENGE1T2,"
                    +"VABMENGE1T3= :VABMENGE1T3,"
                    +"VABMENGE1T4= :VABMENGE1T4,"
                    +"VABMENGEVT1= :VABMENGEVT1,"
                    +"VABMENGEVT2= :VABMENGEVT2,"
                    +"VABMENGEVT3= :VABMENGEVT3,"
                    +"VABMENGEVT4= :VABMENGEVT4,"
                    +"VABMENGEKOR1= :VABMENGEKOR1,"
                    +"VABMENGEKOR2= :VABMENGEKOR2,"
                    +"VABMENGEKOR3= :VABMENGEKOR3,"
                    +"VABMENGEKOR4= :VABMENGEKOR4,"
                    +"VABFAKTT1= :VABFAKTT1,"
                    +"VABFAKTT2= :VABFAKTT2,"
                    +"VABFAKTT3= :VABFAKTT3,"
                    +"VABFAKTT4= :VABFAKTT4,"
                    +"VABRABWERT= :VABRABWERT,"
                    +"VABZUABWERT= :VABZUABWERT,"
                    +"VABTRANSCO= :VABTRANSCO,"
                    +"VABWAEHRSL= :VABWAEHRSL,"
                    +"VABKURS= :VABKURS,"
                    +"VABBETRAG= :VABBETRAG,"
                    +"VABHWAEHRSL= :VABHWAEHRSL,"
                    +"VABHEUROKURS= :VABHEUROKURS,"
                    +"VABHEUROKURSVK= :VABHEUROKURSVK,"
                    +"VABFEUROKURS= :VABFEUROKURS,"
                    +"VABFEUROKURSVK= :VABFEUROKURSVK,"
                    +"VABLESEKZ= :VABLESEKZ,"
                    +"VABMWSTAB= :VABMWSTAB,"
                    +"VABKUNDNRKO= :VABKUNDNRKO,"
                    +"VABKOAUFKRS= :VABKOAUFKRS,"
                    +"VABKOAUFLFD= :VABKOAUFLFD,"
                    +"VABKOAUFPOS= :VABKOAUFPOS,"
                    +"VABKOAUFART= :VABKOAUFART,"
                    +"VABKOAUFKRS1= :VABKOAUFKRS1,"
                    +"VABKOAUFLFD1= :VABKOAUFLFD1,"
                    +"VABKOAUFPOS1= :VABKOAUFPOS1,"
                    +"VABKOAUFART1= :VABKOAUFART1,"
                    +"VABKKOLL= :VABKKOLL,"
                    +"VABMKOLL= :VABMKOLL,"
                    +"VABNOCOUNT= :VABNOCOUNT,"
                    +"VABFARBGRP= :VABFARBGRP,"
                    +"VABVMVB= :VABVMVB,"
                    +"VABVMVG= :VABVMVG,"
                    +"VABKEYAC= :VABKEYAC,"
                    +"VABCOUNTY= :VABCOUNTY,"
                    +"VABKONZMIT= :VABKONZMIT,"
                    +"VABABSSCHL= :VABABSSCHL,"
                    +"VABDISTRWEG= :VABDISTRWEG,"
                    +"VABWERBSL1= :VABWERBSL1,"
                    +"VABWERBSL2= :VABWERBSL2,"
                    +"VABWERBSL3= :VABWERBSL3,"
                    +"VABWERBSL4= :VABWERBSL4,"
                    +"VABWERBSL5= :VABWERBSL5,"
                    +"VABKOLLSEG1= :VABKOLLSEG1,"
                    +"VABKOLLSEG2= :VABKOLLSEG2,"
                    +"VABKOLLSEG3= :VABKOLLSEG3,"
                    +"VABKOLLSEG4= :VABKOLLSEG4,"
                    +"VABKOLLSEG5= :VABKOLLSEG5,"
                    +"VABFEATURE1= :VABFEATURE1,"
                    +"VABFEATURE2= :VABFEATURE2,"
                    +"VABFEATURE3= :VABFEATURE3,"
                    +"VABFEATURE4= :VABFEATURE4,"
                    +"VABFEATURE5= :VABFEATURE5,"
                    +"VABEINSATZG= :VABEINSATZG,"
                    +"VABVERWEND= :VABVERWEND,"
                    +"VABABZKZ= :VABABZKZ,"
                    +"VABVTYP= :VABVTYP,"
                    +"VABFILLER= :VABFILLER,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("VABMANDANT", OracleType.NVarChar).Value = dwData["VABMANDANT"].ToString(); 
          or1.Parameters.Add("VABJAHR", OracleType.NVarChar).Value = dwData["VABJAHR"].ToString(); 
          or1.Parameters.Add("VABMONAT", OracleType.NVarChar).Value = dwData["VABMONAT"].ToString(); 
          or1.Parameters.Add("VABSART", OracleType.NVarChar).Value = dwData["VABSART"].ToString(); 
          or1.Parameters.Add("VABFRSCHL", OracleType.NVarChar).Value = dwData["VABFRSCHL"].ToString(); 
          or1.Parameters.Add("VABAUFART", OracleType.NVarChar).Value = dwData["VABAUFART"].ToString(); 
          or1.Parameters.Add("VABAUFTYP", OracleType.NVarChar).Value = dwData["VABAUFTYP"].ToString(); 
          or1.Parameters.Add("VABAUFKRS", OracleType.NVarChar).Value = dwData["VABAUFKRS"].ToString(); 
          or1.Parameters.Add("VABAUFLFD", OracleType.NVarChar).Value = dwData["VABAUFLFD"].ToString(); 
          or1.Parameters.Add("VABAUFPOS", OracleType.NVarChar).Value = dwData["VABAUFPOS"].ToString(); 
          or1.Parameters.Add("VABERSTAKZ", OracleType.NVarChar).Value = dwData["VABERSTAKZ"].ToString(); 
          or1.Parameters.Add("VABPOSTYP", OracleType.NVarChar).Value = dwData["VABPOSTYP"].ToString(); 
          or1.Parameters.Add("VABCOUPON", OracleType.NVarChar).Value = dwData["VABCOUPON"].ToString(); 
          or1.Parameters.Add("VABORDER", OracleType.NVarChar).Value = dwData["VABORDER"].ToString(); 
          or1.Parameters.Add("VABPRGRP", OracleType.NVarChar).Value = dwData["VABPRGRP"].ToString(); 
          or1.Parameters.Add("VABPROJNR", OracleType.NVarChar).Value = dwData["VABPROJNR"].ToString(); 
          or1.Parameters.Add("VABAEDAT", OracleType.NVarChar).Value = dwData["VABAEDAT"].ToString(); 
          or1.Parameters.Add("VABIAEDAT", OracleType.NVarChar).Value = dwData["VABIAEDAT"].ToString(); 
          or1.Parameters.Add("VABLITERM", OracleType.NVarChar).Value = dwData["VABLITERM"].ToString(); 
          or1.Parameters.Add("VABLIEFEING", OracleType.NVarChar).Value = dwData["VABLIEFEING"].ToString(); 
          or1.Parameters.Add("VABLIEFKOMP", OracleType.NVarChar).Value = dwData["VABLIEFKOMP"].ToString(); 
          or1.Parameters.Add("VABLTART", OracleType.NVarChar).Value = dwData["VABLTART"].ToString(); 
          or1.Parameters.Add("VABVKSACHB", OracleType.NVarChar).Value = dwData["VABVKSACHB"].ToString(); 
          or1.Parameters.Add("VABVB", OracleType.NVarChar).Value = dwData["VABVB"].ToString(); 
          or1.Parameters.Add("VABVG", OracleType.NVarChar).Value = dwData["VABVG"].ToString(); 
          or1.Parameters.Add("VABVERTNR1", OracleType.NVarChar).Value = dwData["VABVERTNR1"].ToString(); 
          or1.Parameters.Add("VABVERTNR2", OracleType.NVarChar).Value = dwData["VABVERTNR2"].ToString(); 
          or1.Parameters.Add("VABVERTNR3", OracleType.NVarChar).Value = dwData["VABVERTNR3"].ToString(); 
          or1.Parameters.Add("VABVERTNR4", OracleType.NVarChar).Value = dwData["VABVERTNR4"].ToString(); 
          or1.Parameters.Add("VABLAND", OracleType.NVarChar).Value = dwData["VABLAND"].ToString(); 
          or1.Parameters.Add("VABKZINLEXP", OracleType.NVarChar).Value = dwData["VABKZINLEXP"].ToString(); 
          or1.Parameters.Add("VABPLZ", OracleType.NVarChar).Value = dwData["VABPLZ"].ToString(); 
          or1.Parameters.Add("VABGEBIET", OracleType.NVarChar).Value = dwData["VABGEBIET"].ToString(); 
          or1.Parameters.Add("VABTLAND", OracleType.NVarChar).Value = dwData["VABTLAND"].ToString(); 
          or1.Parameters.Add("VABTREGBZ", OracleType.NVarChar).Value = dwData["VABTREGBZ"].ToString(); 
          or1.Parameters.Add("VABTKREIS", OracleType.NVarChar).Value = dwData["VABTKREIS"].ToString(); 
          or1.Parameters.Add("VABTORT", OracleType.NVarChar).Value = dwData["VABTORT"].ToString(); 
          or1.Parameters.Add("VABVERS", OracleType.NVarChar).Value = dwData["VABVERS"].ToString(); 
          or1.Parameters.Add("VABKUNDNR", OracleType.NVarChar).Value = dwData["VABKUNDNR"].ToString(); 
          or1.Parameters.Add("VABVERBNR", OracleType.NVarChar).Value = dwData["VABVERBNR"].ToString(); 
          or1.Parameters.Add("VABZENTRR", OracleType.NVarChar).Value = dwData["VABZENTRR"].ToString(); 
          or1.Parameters.Add("VABZENTR", OracleType.NVarChar).Value = dwData["VABZENTR"].ToString(); 
          or1.Parameters.Add("VABBRANCHE", OracleType.NVarChar).Value = dwData["VABBRANCHE"].ToString(); 
          or1.Parameters.Add("VABABNGRP", OracleType.NVarChar).Value = dwData["VABABNGRP"].ToString(); 
          or1.Parameters.Add("VABABCKL", OracleType.NVarChar).Value = dwData["VABABCKL"].ToString(); 
          or1.Parameters.Add("VABKUNDNRST", OracleType.NVarChar).Value = dwData["VABKUNDNRST"].ToString(); 
          or1.Parameters.Add("VABABNGRPST", OracleType.NVarChar).Value = dwData["VABABNGRPST"].ToString(); 
          or1.Parameters.Add("VABBUSIMODE", OracleType.NVarChar).Value = dwData["VABBUSIMODE"].ToString(); 
          or1.Parameters.Add("VABPRDGR", OracleType.NVarChar).Value = dwData["VABPRDGR"].ToString(); 
          or1.Parameters.Add("VABARTGRP", OracleType.NVarChar).Value = dwData["VABARTGRP"].ToString(); 
          or1.Parameters.Add("VABZIELGR", OracleType.NVarChar).Value = dwData["VABZIELGR"].ToString(); 
          or1.Parameters.Add("VABPVGRP", OracleType.NVarChar).Value = dwData["VABPVGRP"].ToString(); 
          or1.Parameters.Add("VABOBERKOLL", OracleType.NVarChar).Value = dwData["VABOBERKOLL"].ToString(); 
          or1.Parameters.Add("VABKOLL", OracleType.NVarChar).Value = dwData["VABKOLL"].ToString(); 
          or1.Parameters.Add("VABVART", OracleType.NVarChar).Value = dwData["VABVART"].ToString(); 
          or1.Parameters.Add("VABVFARBE", OracleType.NVarChar).Value = dwData["VABVFARBE"].ToString(); 
          or1.Parameters.Add("VABVGROE", OracleType.NVarChar).Value = dwData["VABVGROE"].ToString(); 
          or1.Parameters.Add("VABVZENSUR", OracleType.NVarChar).Value = dwData["VABVZENSUR"].ToString(); 
          or1.Parameters.Add("VABVAUFMART", OracleType.NVarChar).Value = dwData["VABVAUFMART"].ToString(); 
          or1.Parameters.Add("VABVVERPART", OracleType.NVarChar).Value = dwData["VABVVERPART"].ToString(); 
          or1.Parameters.Add("VABLIEFSG", OracleType.NVarChar).Value = dwData["VABLIEFSG"].ToString(); 
          or1.Parameters.Add("VABVZOLLTNR", OracleType.NVarChar).Value = dwData["VABVZOLLTNR"].ToString(); 
          or1.Parameters.Add("VABSTATWNR", OracleType.NVarChar).Value = dwData["VABSTATWNR"].ToString(); 
          or1.Parameters.Add("VABPRODST", OracleType.NVarChar).Value = dwData["VABPRODST"].ToString(); 
          or1.Parameters.Add("VABDKUNDNR", OracleType.NVarChar).Value = dwData["VABDKUNDNR"].ToString(); 
          or1.Parameters.Add("VABWERK", OracleType.NVarChar).Value = dwData["VABWERK"].ToString(); 
          or1.Parameters.Add("VABABT", OracleType.NVarChar).Value = dwData["VABABT"].ToString(); 
          or1.Parameters.Add("VABDART", OracleType.NVarChar).Value = dwData["VABDART"].ToString(); 
          or1.Parameters.Add("VABDVAR", OracleType.NVarChar).Value = dwData["VABDVAR"].ToString(); 
          or1.Parameters.Add("VABPWAKZ", OracleType.NVarChar).Value = dwData["VABPWAKZ"].ToString(); 
          or1.Parameters.Add("VABPART", OracleType.NVarChar).Value = dwData["VABPART"].ToString(); 
          or1.Parameters.Add("VABPADESS", OracleType.NVarChar).Value = dwData["VABPADESS"].ToString(); 
          or1.Parameters.Add("VABPACOLORIT", OracleType.NVarChar).Value = dwData["VABPACOLORIT"].ToString(); 
          or1.Parameters.Add("VABPABESCH", OracleType.NVarChar).Value = dwData["VABPABESCH"].ToString(); 
          or1.Parameters.Add("VABPAFARBE", OracleType.NVarChar).Value = dwData["VABPAFARBE"].ToString(); 
          or1.Parameters.Add("VABPVAR", OracleType.NVarChar).Value = dwData["VABPVAR"].ToString(); 
          or1.Parameters.Add("VABPHK1", OracleType.NVarChar).Value = dwData["VABPHK1"].ToString(); 
          or1.Parameters.Add("VABPHK2", OracleType.NVarChar).Value = dwData["VABPHK2"].ToString(); 
          or1.Parameters.Add("VABPHK3", OracleType.NVarChar).Value = dwData["VABPHK3"].ToString(); 
          or1.Parameters.Add("VABPHK4", OracleType.NVarChar).Value = dwData["VABPHK4"].ToString(); 
          or1.Parameters.Add("VABPHK5", OracleType.NVarChar).Value = dwData["VABPHK5"].ToString(); 
          or1.Parameters.Add("VABPHK6", OracleType.NVarChar).Value = dwData["VABPHK6"].ToString(); 
          or1.Parameters.Add("VABPLART", OracleType.NVarChar).Value = dwData["VABPLART"].ToString(); 
          or1.Parameters.Add("VABRFDDIS", OracleType.NVarChar).Value = dwData["VABRFDDIS"].ToString(); 
          or1.Parameters.Add("VABUMSATZAUFTR", OracleType.NVarChar).Value = dwData["VABUMSATZAUFTR"].ToString(); 
          or1.Parameters.Add("VABMENGE1", OracleType.NVarChar).Value = dwData["VABMENGE1"].ToString(); 
          or1.Parameters.Add("VABMENGE2", OracleType.NVarChar).Value = dwData["VABMENGE2"].ToString(); 
          or1.Parameters.Add("VABMENGE3", OracleType.NVarChar).Value = dwData["VABMENGE3"].ToString(); 
          or1.Parameters.Add("VABMENGE4", OracleType.NVarChar).Value = dwData["VABMENGE4"].ToString(); 
          or1.Parameters.Add("VABMENGE1T1", OracleType.NVarChar).Value = dwData["VABMENGE1T1"].ToString(); 
          or1.Parameters.Add("VABMENGE1T2", OracleType.NVarChar).Value = dwData["VABMENGE1T2"].ToString(); 
          or1.Parameters.Add("VABMENGE1T3", OracleType.NVarChar).Value = dwData["VABMENGE1T3"].ToString(); 
          or1.Parameters.Add("VABMENGE1T4", OracleType.NVarChar).Value = dwData["VABMENGE1T4"].ToString(); 
          or1.Parameters.Add("VABMENGEVT1", OracleType.NVarChar).Value = dwData["VABMENGEVT1"].ToString(); 
          or1.Parameters.Add("VABMENGEVT2", OracleType.NVarChar).Value = dwData["VABMENGEVT2"].ToString(); 
          or1.Parameters.Add("VABMENGEVT3", OracleType.NVarChar).Value = dwData["VABMENGEVT3"].ToString(); 
          or1.Parameters.Add("VABMENGEVT4", OracleType.NVarChar).Value = dwData["VABMENGEVT4"].ToString(); 
          or1.Parameters.Add("VABMENGEKOR1", OracleType.NVarChar).Value = dwData["VABMENGEKOR1"].ToString(); 
          or1.Parameters.Add("VABMENGEKOR2", OracleType.NVarChar).Value = dwData["VABMENGEKOR2"].ToString(); 
          or1.Parameters.Add("VABMENGEKOR3", OracleType.NVarChar).Value = dwData["VABMENGEKOR3"].ToString(); 
          or1.Parameters.Add("VABMENGEKOR4", OracleType.NVarChar).Value = dwData["VABMENGEKOR4"].ToString(); 
          or1.Parameters.Add("VABFAKTT1", OracleType.NVarChar).Value = dwData["VABFAKTT1"].ToString(); 
          or1.Parameters.Add("VABFAKTT2", OracleType.NVarChar).Value = dwData["VABFAKTT2"].ToString(); 
          or1.Parameters.Add("VABFAKTT3", OracleType.NVarChar).Value = dwData["VABFAKTT3"].ToString(); 
          or1.Parameters.Add("VABFAKTT4", OracleType.NVarChar).Value = dwData["VABFAKTT4"].ToString(); 
          or1.Parameters.Add("VABRABWERT", OracleType.NVarChar).Value = dwData["VABRABWERT"].ToString(); 
          or1.Parameters.Add("VABZUABWERT", OracleType.NVarChar).Value = dwData["VABZUABWERT"].ToString(); 
          or1.Parameters.Add("VABTRANSCO", OracleType.NVarChar).Value = dwData["VABTRANSCO"].ToString(); 
          or1.Parameters.Add("VABWAEHRSL", OracleType.NVarChar).Value = dwData["VABWAEHRSL"].ToString(); 
          or1.Parameters.Add("VABKURS", OracleType.NVarChar).Value = dwData["VABKURS"].ToString(); 
          or1.Parameters.Add("VABBETRAG", OracleType.NVarChar).Value = dwData["VABBETRAG"].ToString(); 
          or1.Parameters.Add("VABHWAEHRSL", OracleType.NVarChar).Value = dwData["VABHWAEHRSL"].ToString(); 
          or1.Parameters.Add("VABHEUROKURS", OracleType.NVarChar).Value = dwData["VABHEUROKURS"].ToString(); 
          or1.Parameters.Add("VABHEUROKURSVK", OracleType.NVarChar).Value = dwData["VABHEUROKURSVK"].ToString(); 
          or1.Parameters.Add("VABFEUROKURS", OracleType.NVarChar).Value = dwData["VABFEUROKURS"].ToString(); 
          or1.Parameters.Add("VABFEUROKURSVK", OracleType.NVarChar).Value = dwData["VABFEUROKURSVK"].ToString(); 
          or1.Parameters.Add("VABLESEKZ", OracleType.NVarChar).Value = dwData["VABLESEKZ"].ToString(); 
          or1.Parameters.Add("VABMWSTAB", OracleType.NVarChar).Value = dwData["VABMWSTAB"].ToString(); 
          or1.Parameters.Add("VABKUNDNRKO", OracleType.NVarChar).Value = dwData["VABKUNDNRKO"].ToString(); 
          or1.Parameters.Add("VABKOAUFKRS", OracleType.NVarChar).Value = dwData["VABKOAUFKRS"].ToString(); 
          or1.Parameters.Add("VABKOAUFLFD", OracleType.NVarChar).Value = dwData["VABKOAUFLFD"].ToString(); 
          or1.Parameters.Add("VABKOAUFPOS", OracleType.NVarChar).Value = dwData["VABKOAUFPOS"].ToString(); 
          or1.Parameters.Add("VABKOAUFART", OracleType.NVarChar).Value = dwData["VABKOAUFART"].ToString(); 
          or1.Parameters.Add("VABKOAUFKRS1", OracleType.NVarChar).Value = dwData["VABKOAUFKRS1"].ToString(); 
          or1.Parameters.Add("VABKOAUFLFD1", OracleType.NVarChar).Value = dwData["VABKOAUFLFD1"].ToString(); 
          or1.Parameters.Add("VABKOAUFPOS1", OracleType.NVarChar).Value = dwData["VABKOAUFPOS1"].ToString(); 
          or1.Parameters.Add("VABKOAUFART1", OracleType.NVarChar).Value = dwData["VABKOAUFART1"].ToString(); 
          or1.Parameters.Add("VABKKOLL", OracleType.NVarChar).Value = dwData["VABKKOLL"].ToString(); 
          or1.Parameters.Add("VABMKOLL", OracleType.NVarChar).Value = dwData["VABMKOLL"].ToString(); 
          or1.Parameters.Add("VABNOCOUNT", OracleType.NVarChar).Value = dwData["VABNOCOUNT"].ToString(); 
          or1.Parameters.Add("VABFARBGRP", OracleType.NVarChar).Value = dwData["VABFARBGRP"].ToString(); 
          or1.Parameters.Add("VABVMVB", OracleType.NVarChar).Value = dwData["VABVMVB"].ToString(); 
          or1.Parameters.Add("VABVMVG", OracleType.NVarChar).Value = dwData["VABVMVG"].ToString(); 
          or1.Parameters.Add("VABKEYAC", OracleType.NVarChar).Value = dwData["VABKEYAC"].ToString(); 
          or1.Parameters.Add("VABCOUNTY", OracleType.NVarChar).Value = dwData["VABCOUNTY"].ToString(); 
          or1.Parameters.Add("VABKONZMIT", OracleType.NVarChar).Value = dwData["VABKONZMIT"].ToString(); 
          or1.Parameters.Add("VABABSSCHL", OracleType.NVarChar).Value = dwData["VABABSSCHL"].ToString(); 
          or1.Parameters.Add("VABDISTRWEG", OracleType.NVarChar).Value = dwData["VABDISTRWEG"].ToString(); 
          or1.Parameters.Add("VABWERBSL1", OracleType.NVarChar).Value = dwData["VABWERBSL1"].ToString(); 
          or1.Parameters.Add("VABWERBSL2", OracleType.NVarChar).Value = dwData["VABWERBSL2"].ToString(); 
          or1.Parameters.Add("VABWERBSL3", OracleType.NVarChar).Value = dwData["VABWERBSL3"].ToString(); 
          or1.Parameters.Add("VABWERBSL4", OracleType.NVarChar).Value = dwData["VABWERBSL4"].ToString(); 
          or1.Parameters.Add("VABWERBSL5", OracleType.NVarChar).Value = dwData["VABWERBSL5"].ToString(); 
          or1.Parameters.Add("VABKOLLSEG1", OracleType.NVarChar).Value = dwData["VABKOLLSEG1"].ToString(); 
          or1.Parameters.Add("VABKOLLSEG2", OracleType.NVarChar).Value = dwData["VABKOLLSEG2"].ToString(); 
          or1.Parameters.Add("VABKOLLSEG3", OracleType.NVarChar).Value = dwData["VABKOLLSEG3"].ToString(); 
          or1.Parameters.Add("VABKOLLSEG4", OracleType.NVarChar).Value = dwData["VABKOLLSEG4"].ToString(); 
          or1.Parameters.Add("VABKOLLSEG5", OracleType.NVarChar).Value = dwData["VABKOLLSEG5"].ToString(); 
          or1.Parameters.Add("VABFEATURE1", OracleType.NVarChar).Value = dwData["VABFEATURE1"].ToString(); 
          or1.Parameters.Add("VABFEATURE2", OracleType.NVarChar).Value = dwData["VABFEATURE2"].ToString(); 
          or1.Parameters.Add("VABFEATURE3", OracleType.NVarChar).Value = dwData["VABFEATURE3"].ToString(); 
          or1.Parameters.Add("VABFEATURE4", OracleType.NVarChar).Value = dwData["VABFEATURE4"].ToString(); 
          or1.Parameters.Add("VABFEATURE5", OracleType.NVarChar).Value = dwData["VABFEATURE5"].ToString(); 
          or1.Parameters.Add("VABEINSATZG", OracleType.NVarChar).Value = dwData["VABEINSATZG"].ToString(); 
          or1.Parameters.Add("VABVERWEND", OracleType.NVarChar).Value = dwData["VABVERWEND"].ToString(); 
          or1.Parameters.Add("VABABZKZ", OracleType.NVarChar).Value = dwData["VABABZKZ"].ToString(); 
          or1.Parameters.Add("VABVTYP", OracleType.NVarChar).Value = dwData["VABVTYP"].ToString(); 
          or1.Parameters.Add("VABFILLER", OracleType.NVarChar).Value = dwData["VABFILLER"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
